from django.db import models

# Create your models here.
# 用户表
class User(models.Model):
    qq = models.CharField(max_length=15)
    pwd = models.CharField(max_length=20)
    Count = models.CharField(max_length=20)
    email = models.CharField(max_length=30)
    createTime = models.DateField(auto_now_add=True)

# 用户登入表
class UserLogin(models.Model):
    qq = models.CharField(max_length=15)
    time1 = models.DateTimeField()
    time2 = models.DateTimeField()
    time3 = models.DateTimeField()
    time4 = models.DateTimeField()
    time5 = models.DateTimeField()
    ip1 = models.CharField(max_length=20)
    ip2 = models.CharField(max_length=20)
    ip3 = models.CharField(max_length=20)
    ip4 = models.CharField(max_length=20)
    ip5 = models.CharField(max_length=20)
    place1 = models.CharField(max_length=50)
    place2 = models.CharField(max_length=50)
    place3 = models.CharField(max_length=50)
    place4 = models.CharField(max_length=50)
    place5 = models.CharField(max_length=50)

# 用户控制中心
class control(models.Model):
    qq = models.CharField(max_length=15)
    invate = models.CharField(max_length=100)
    jiemaID = models.IntegerField()
    pwdSet = models.BooleanField()
    workNum = models.IntegerField()
    workThread = models.IntegerField()
    jiemaPlat = models.IntegerField()
    damaPlat = models.IntegerField()
    ipSet = models.IntegerField()

# 接码设置表
class jiemaUserSet(models.Model):
    qq = models.CharField(max_length=15)
    plat = models.IntegerField()
    jiemaCount = models.CharField(max_length=20)
    jiemaPwd = models.CharField(max_length=20)
    isChoice = models.BooleanField()
    def __str__(self):
        return self.qq + "--" + self.plat

# 接码平台表
class jiemaPlat(models.Model):
    platID = models.IntegerField()
    platName = models.CharField(max_length=10)
    loginUrl = models.CharField(max_length=100)
    getPhoneUrl = models.CharField(max_length=100)
    getCodeUrl = models.CharField(max_length=100)
    getinfo = models.CharField(max_length=100)
    def __str__(self):
        return self.platName

# 打码平台表
class damaPlat(models.Model):
    platID = models.IntegerField()
    platName = models.CharField(max_length=10)
    getCodeUrl = models.CharField(max_length=100)
    getinfo = models.CharField(max_length=100)
    softwareId = models.CharField(max_length=256)
    softwareSecret = models.CharField(max_length=256)
    devid = models.CharField(max_length=65)
    def __str__(self):
        return self.platName

# 打码设置表
class damaUserSet(models.Model):
    qq = models.CharField(max_length=15)
    plat = models.IntegerField()
    damaCount = models.CharField(max_length=20)
    damaPwd = models.CharField(max_length=20)
    secretkey = models.CharField(max_length=256,default="null")
    SNcode = models.CharField(max_length=256, default="null")
    isChoice = models.BooleanField()

# 讯代理
class xunIpSet(models.Model):
    qq = models.CharField(max_length=15)
    secret = models.CharField(max_length=100)
    spiderId = models.CharField(max_length=100)
    orderA1 = models.CharField(max_length=100)
    orderA2 = models.CharField(max_length=100, default="null")
    isChoice = models.BooleanField(default="0")

# 熊猫代理
class pandaIpSet(models.Model):
    qq = models.CharField(max_length=15)
    secret = models.CharField(max_length=100)
    orderB1 = models.CharField(max_length=100)
    orderB2 = models.CharField(max_length=100,default="null")
    isChoice = models.BooleanField(default="0")

# 用户项目管理
class UserProjects(models.Model):
    proName = models.CharField(max_length=50)
    projectID = models.IntegerField()
    author = models.CharField(max_length=20)
    workNum = models.IntegerField()
    desc = models.TextField()

# 用户项目记录
class projectRecord(models.Model):
    qq = models.CharField(max_length=15)
    workNum = models.IntegerField()
    firstTime = models.DateTimeField(auto_now_add=True)
    lastTime = models.DateTimeField(auto_now=True)
    lastIp = models.CharField(max_length=20)
    lastPlace = models.CharField(max_length=50)